[(not yet) BREAKING CHANGE] keymaps option #605
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-> Work done by @traxys and myself
The current
mapsoption which allows to define keymaps in nixvim has a few flaws.For instance, it is not possible to declare a mapping in several modes at once.
In order to wrap the underlying
vim.keymap.set()function more natively, we have decided to change this fundamental option.We have introduced a new option called
keymapswhich expects a list ofsubmodule.As an example is worth 1000 words, here is what it looks like:
We would like to highlight that this new syntax feels way more natural regarding the neovim API.
This is the main motivation for this change as well as the numerous simplifications it thus brings.
Note: For now, the legacy
mapsoption is still supported and will cause a warning to be shown at build time.Relevant discussion: #576